package com.gxa.controller;

import com.gxa.common.R;
import com.gxa.pojo.Receipt_Outin;
import com.gxa.service.OutListService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Controller
@Api(value = "其它出入库数据test",tags = "其它出入库数据接口API")
public class OutListController {

    R r = new R();

    @Autowired(required = false)
    private OutListService outListService;

    @RequestMapping(value = "/saveOutinList",method = RequestMethod.POST)
    @ApiOperation(value = "新增其他出库接口",notes = "添加其他出库",httpMethod = "POST", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=401,message="仓库名不能相同"),
            @ApiResponse(code=402,message="库存不足"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @ResponseBody
    public R saveOrderForm(@RequestBody @ApiParam Receipt_Outin receipt_outin) {
        R r = outListService.saveOutList(receipt_outin);
        return r;
    }

    @RequestMapping(value = "/queryOutList",method = RequestMethod.POST)
    @ApiOperation(value = "查询其它出库单接口",notes = "查询其它出库单",httpMethod = "POST", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @ResponseBody
    public R queryOrderForm(@RequestBody @ApiParam(name = "map",value = "用户名和密码",required = true) Map map) {
        R r = outListService.queryOutinInfo(map);
        return r;
    }

    @RequestMapping(value = "/delOutList",method = RequestMethod.GET)
    @ApiOperation(value = "删除接口",notes = "删除", httpMethod = "GET", response = R.class)
    @ApiImplicitParam(name = "transferOrderId",value = "删除",required = false,paramType = "query",dataType = "String")
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @ResponseBody
    public  R  delTransferOrder(@RequestParam(name = "receipt_Outin_Id") String receipt_Outin_Id){
        R r = outListService.delOutList(receipt_Outin_Id);
        return  r;
    }

    @RequestMapping(value = "/saveWarehouseReceipt",method = RequestMethod.POST)
    @ApiOperation(value = "新增其它入库单接口",notes = "添加其它入库单",httpMethod = "POST", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=401,message="仓库名不能相同"),
            @ApiResponse(code=402,message="库存不足"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @ResponseBody
    public R saveWarehouseReceipt(@RequestBody @ApiParam Receipt_Outin receipt_outin) {
        R r = outListService.saveWarehouseReceipt(receipt_outin);
        return r;
    }
    @RequestMapping(value = "/queryWarehouseReceipt",method = RequestMethod.POST)
    @ApiOperation(value = "查询其它入库单接口",notes = "查询其它入库单",httpMethod = "POST", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @ResponseBody
    public R queryWarehouseReceipt(@RequestBody @ApiParam(name = "map",value = "用户名和密码",required = true) Map map) {
        R r = outListService.queryWarehouseReceipt(map);
        return r;
    }
}
